package com.gxa.hotel.portal.config;


import com.gxa.hotel.portal.interceptor.TokenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    //注册拦截器,就调用addInterceptors

    @Autowired
    TokenInterceptor tokenInterceptor=null;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokenInterceptor)
                .addPathPatterns("/serach/**")
                .addPathPatterns("/order/**")
                .addPathPatterns("/cart/**")
        //TODO 测试沙箱支付,临时注释
//                .addPathPatterns("/pay/**")
               ;
    }
}
